*******************************************************************************
******************************  TABLE A10  ************************************
******  Women's Individual Pre-deliberation Task Performance Relative to  *****
********  Expert Scores and Implied Initial Performance of Group  *************
*******************************************************************************

//cd "C:/Users/ganth/Dropbox/StrengthInNumbersReplicationPackage/replicable/table_a10"

********************************************************************************

use "table_a10_dataset_1.dta", clear
eststo clear
eststo p1c1: reg total_lab1 maleMajority if female==1
estadd ysumm
eststo p1c2: reg total_lab2 maleMajority if female==1
estadd ysumm
eststo p1c3: reg total_labavg maleMajority if female==1
estadd ysumm

eststo p2c1: reg igavg_total_lab1 maleMajority if female==1
estadd ysumm
eststo p2c2: reg igavg_total_lab2 maleMajority if female==1
estadd ysumm
eststo p2c3:reg igavg_total_labavg maleMajority if female==1
estadd ysumm


use "table_a10_dataset_2.dta", clear
eststo p1c4: reg total_labavg maleMajority if female==1	
estadd ysumm

eststo p2c4: reg igavg_total_labavg maleMajority if female==1
estadd ysumm


append using "table_a10_dataset_1.dta"

eststo p1c5: reg total_labavg maleMajority if female==1	
estadd ysumm
eststo p2c5: reg igavg_total_labavg maleMajority if female==1
estadd ysumm

esttab p1c1 p1c2 p1c3 p1c4 p1c5 using "table_a10_panel_1.tex", style(tex) ///
label replace ///
stats(ymean ysd, fmt( %9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mgroups("Study 1" "Study 2" "Studies 1 + 2", pattern(1 0 0 1 1 ) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
mtitles("Task 1" "Task 2" "Task 1 + 2"  "Task 1"  "All Combined") ///
nonotes nonum 


esttab p2c1 p2c2 p2c3  p2c4  p2c5 using "table_a10_panel_2.tex", style(tex) ///
stats(ymean ysd N, fmt( %9.2f  %9.2f %9.0g ) ///
labels("Mean of outcome" "St. dev. of outcome" "\$N$ (both panels)" )) label replace ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mgroups("Study 1" "Study 2" "Studies 1 + 2", pattern(1 0 0 1 1 ) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
mtitles("Task 1" "Task 2" "Task 1 + 2"  "Task 1"  "All Combined") ///
nonotes nonum


include "https://raw.githubusercontent.com/steveofconnell/PanelCombine/master/PanelCombine.do"
panelcombine, use(table_a10_panel_1.tex table_a10_panel_2.tex) ///
paneltitles("Women's Average Initial Task Error Rate" "Women's Average Distance from Initial Group Average") columncount(6) save("table_a10.tex") cleanup
